<style type="text/css">
body{background:#eee}
.storelogo img{width:3.2rem;height:3.2rem}
.merchgroup .store-star {padding:0.1rem 0 0.2rem 0;font-size:0.55rem;line-height:1rem}
.merchgroup .store-star img{height:0.66rem}
.star-on,.star-off{position:absolute;top:1rem;left:0;overflow:hidden}
.star-rate {margin-left:0.2rem;color:#19b955}
.store-distance{float:right;color:#999}
.store-moneylimit{font-size:0.55rem}
</style>
<div class="fui-page order-create-page fui-page-current" style="margin-top:2.5rem">
	<div class="fui-content  navbar">
		<div class="fui-title-c" onclick="wait_driver()" ng-show="pagedata.info.show==0" >
			<i class="icon jinyunicon icon-shijian" style="color:#666"></i>
			<div class="title" style="color:#f60;font-size:1.3rem;margin-top:-18px" id="wait_min"></div>
			<div class="subtitle">正在等待司机接单...</div>
		</div>
		<div class="fui-title-c" onclick="wait_driver()" ng-show="pagedata.info.show==1">
			<i class="icon jinyunicon icon-biaoqing" style="color:#666"></i>
			<div class="subtitle" style="margin-top:-18px">司机已接单...</div>
		</div>
		<div class="weui_cells" style="margin:2%" ng-show="pagedata.info.show==1">
			<div class="weui_cell" id="r-result">
				<div class="weui_cell_bd weui_cell_primary">司机姓名:</div>
				<div class="weui_cell_ft" >{{pagedata.info.name}}</div>
			</div>
			<div class="weui_cell" id="r-result">
				<div class="weui_cell_bd weui_cell_primary">联系电话:</div>
				<div class="weui_cell_ft" >{{pagedata.info.mobile}}</div>
			</div>
			<div class="weui_cell" id="r-result">
				<div class="weui_cell_bd weui_cell_primary">司机距你:</div>
				<div class="weui_cell_ft" >{{pagedata.info.jjuli}}</div>
			</div>
			<div class="fui-icon-group noborder col-3">
                <a class="fui-icon-col external" href="">
					<div class="text" style="color: #666666;">行程距离</div>
                    <div class="icon"><i class="icon jinyunicon icon-ditu"/></div>
                    <div class="text" style="color: #F60;">{{pagedata.info.juli}}</div>
                </a>
                <a class="fui-icon-col external" href="">
					<div class="text" style="color: #666666;">预计时间</div>
                    <div class="icon"><i class="icon jinyunicon icon-shijian"/></div>
                     <div class="text" style="color: #F60;">{{pagedata.info.time}}</div>
                </a>
                <a class="fui-icon-col external" href="" data-nocache="true">
					<div class="text" style="color: #666666;">预计价格</div>
                    <div class="icon"><i class="icon jinyunicon icon-goumai"/></div>
                    <div class="text" style="color: #F60;">￥{{pagedata.info.price}}元</div>
                </a>
			</div>
		</div>
	</div>
</div>
<div ng-include="sys_html('_menu')"></div>
<script type="text/javascript">
wait_driver();
require(['jinyun_socket'],function(jinyun_socket){
	jinyun_socket.connect();
	//alert('连接成功');
	jinyun_socket.onsystem=function(res){
		//alert('收到系统消息');
		var info = JSON.parse(res.message);
		
			scope.pagedata.info.show = 1;
			scope.pagedata.info.mobile = info.mobile;
			scope.pagedata.info.name = info.name;
			scope.pagedata.info.jjuli = info.jjuli;
			scope.pagedata.info.juli = info.juli;
			scope.pagedata.info.time = info.time;
			scope.pagedata.info.price = info.price;
			scope.pagedata.info.price2 = info.price2;
			scope.pagedata.info.price1 = info.price1;
			scope.$evalAsync();
	}
});
/*
var ws = new WebSocket('ws://forward.jinyunweb.com:8888');
var message_pre=scope.pagedata.message_pre1;//将后端传来的消息前缀存入变量备用
ws.onopen = function(){
    var message = message_pre+'0;success';//0表示发送心跳
    ws.send(message);
};
ws.onmessage = function(e){
    //接收来自云平台的消息并处理
    var data=e.data.split(';');
    var from_uid=data['0'];
    if(from_uid == 0){
	//alert(data['1']);
        //0表示系统消息，例如转发消息时，系统会推送一个转发结果回来
    }else{
		var info = JSON.parse(data['1']);
		scope.$apply(function(){
			scope.pagedata.info.show = 1;
			scope.pagedata.info.mobile = info.mobile;
			scope.pagedata.info.name = info.name;
			scope.pagedata.info.jjuli = info.jjuli;
			scope.pagedata.info.juli = info.juli;
			scope.pagedata.info.time = info.time;
			scope.pagedata.info.price = info.price;
			scope.pagedata.info.price2 = info.price2;
			scope.pagedata.info.price1 = info.price1;
				
		});
    }
}*/
//发送消息给指定用户
//var message=message_pre+'2;你好';//把“你好”这条消息发送给ID为2的用户
//ws.send(message);	
function wait_driver(){
	scope.count_down(60,'wait_min','秒','点击重新呼叫司机');
	
}
</script>